﻿using System;
using Pay.DTO;
using Pay.TO;

namespace Pay.IService {
	public interface IRefundService {
		/// <summary>
		/// 退款查询
		/// </summary>
		/// <param name="refundQuery"></param>
		/// <returns></returns>
		PagedResult<refund_dto> Get(RefundQuery refundQuery);
		/// <summary>
		/// 查询退款订单
		/// </summary>
		/// <param name="refund_id"></param>
		/// <returns></returns>
		refund_dto Get(long refund_id);
		/// <summary>
		/// 查询退款订单
		/// </summary>
		/// <param name="order_no"></param>
		/// <returns></returns>
		refund_dto Get(string order_no);
		/// <summary>
		/// 查询退款订单
		/// </summary>
		/// <param name="transactionNo"></param>
		/// <returns></returns>
		refund_dto GetByTran(string transactionNo);
		/// <summary>
		/// 申请退款
		/// </summary>
		/// <param name="dto"></param>
		/// <returns></returns>
		int ApplyRefund(refund_model dto);
		/// <summary>
		/// 取消退货
		/// </summary>
		/// <param name="refund_id"></param>
		/// <returns></returns>
		int Cancel(long refund_id);
		/// <summary>
		/// 平台提交退款,调用第三方退款API
		/// </summary>
		/// <param name="refund_id"></param>
		/// <returns></returns>
		string PlatformRefundAmount(long refund_id);
		/// <summary>
		/// 平台退款成功，支付通道原路回退成功后回调方法，如果是用余额支付，一定是成功的，
		/// UI上要可以由财务手动处理退款单为完成，用于第三方的可能的异常
		/// </summary>
		/// <param name="pay_no">提交第三方的交易号</param>
		/// <param name="transaction_no">第三方支付流水号</param>
		/// <param name="pay_time"></param>
		/// <param name="status"></param>
		/// <param name="fail">失败原因</param>
		/// <returns></returns>
		int PlatformRefundAmount(string pay_no, string transaction_no, DateTime? pay_time, RefundStatus status, string fail = "");
	}
}
